import { RouteRecordRaw } from 'vue-router'
import homePage from '@/views/home-page/index.vue'

export const staticRouter: RouteRecordRaw[] = [
	{
		path: '/',
		redirect: '/three/base-three'
	}
]

export const otherRouter: RouteRecordRaw[] = [
	{
		path: '/home',
		name: 'home',
		component: homePage,
		meta: {
			title: '首页',
			icon: 'adv-tabbar-ana-filled',
			keepAlive: true
		}
	},
	{
		path: '/three',
		component: () => import('@/layout/index.vue'),
		redirect: '/three/base-three',
		name: 'Three',
		meta: {
			title: 'three Demo',
			icon: 'adv-tabbar-ana-filled',
			keepAlive: true,
			parentName: ''
		},
		children: [
			{
				path: 'base-three',
				component: () => import('@/views/three-page/base-page/index.vue'),
				name: 'baseThree',
				meta: {
					title: '基础Three',
					icon: 'adv-gear-filled',
					keepAlive: true,
					parentName: 'three'
				}
			}
		]
	}
]

/**
 * errorRouter (错误页面路由)
 */
export const errorRouter: RouteRecordRaw[] = [
	{
		path: '/403',
		name: '403',
		component: () => import('@/components/error-message/403.vue'),
		meta: {
			title: '403页面'
		}
	},
	{
		path: '/404',
		name: '404',
		component: () => import('@/components/error-message/404.vue'),
		meta: {
			title: '404页面'
		}
	},
	{
		path: '/500',
		name: '500',
		component: () => import('@/components/error-message/500.vue'),
		meta: {
			title: '500页面'
		}
	},
	// Resolve refresh page, route warnings
	{
		path: '/:pathMatch(.*)*',
		component: () => import('@/components/error-message/404.vue')
	}
]
